package jmine.tec.persist.schema.association;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import jmine.tec.persist.annotation.Alias;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import bancosys.tec.component.Documentation;
import bancosys.tec.persist.bussobj.PersistableBusinessObject;

@Entity
@Alias("DVALUE")
@Table(name = "DVALUE")
@Documentation("TABELA VALOR")
@SequenceGenerator(name = "SEQ_DVALUE", sequenceName = "SEQ_DVALUE")
public class DescribedValueEntity extends PersistableBusinessObject {

    private Long id;

    /**
     * Construtor
     */
    public DescribedValueEntity() {
    }

    public DescribedValueEntity(Long id) {
        this.id = id;
    }

    /**
     * @return the id
     */
    @Id
    @GeneratedValue(generator = "SEQ_VALUE")
    @Column(name = "COD_VALUE", precision = 16, nullable = false)
    @Documentation("CODIGO DO VALOR")
    public Long getId() {
        return this.id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object obj) {
        return EqualsBuilder.reflectionEquals(this, obj);
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE);
    }
}
